package com.tb.dubbo_service;

import com.tb.dubbo.IKindService;
import com.tb.mapper.KindMapper;
import com.tb.pojo.Kind;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
public class KindServiceImpl implements IKindService {
    @Autowired
    private KindMapper kindMapper;
    @Override
    public List<Kind> selecetKinds(Map map) {
        return kindMapper.selectByList(map);
    }

    @Override
    public int addKind(Kind kind) {
        return kindMapper.insert( kind );
    }

    @Override
    public int updateKind(Kind kind) {
        return kindMapper.updateByPrimaryKeySelective( kind );
    }

    @Override
    public int deleteKind(int kindId) {

        return kindMapper.deleteByKeyAll(kindId);
    }
}
